<template>
    <!--采购订单-->
    <div id="PoDetail">
        <v-details :detailData="inputData" :inputConfig="inputConfig" :rules="rules" @pop="setdata"></v-details>
    </div>
</template>

<script>
    import details from 'commons/Detail'
    import baseMixin from "@/mixins/BaseMixin";

    export default {
        mixins: [baseMixin],
        props: {
            inputData: {
                type: Object
            }
        },
        name: "PoDetail",
        data() {
            return {
                inputConfig: [
                    [
                        {
                            type: "input",
                            label: this.$t('in.pokey1'),
                            disabled: true,
                            props: "pokey",
                        },
                        {
                            type: "select",
                            label: this.$t('common.status'),
                            disabled: true,
                            props: "status",
                            options: this.getOptions("codelkup/POSTATUS")
                        },
                        {
                            type: "select",
                            label: this.$t('common.type'),
                            disabled: true,
                            props: "potype",
                            options: this.getOptions("codelkup/POTYPE")
                        },
                        {
                            type: "date",
                            label: this.$t('in.podate1'),
                            disabled: true,
                            props: "podate",
                        },
                    ],
                    [

                        {
                            type: "input",
                            label: this.$t('in.externpokey'),
                            disabled: true,
                            props: "externpokey"
                        },
                        {
                            type: "table",
                            label: this.$t('in.storerkey'),
                            disabled: true,
                            props: "storerkey",
                            tableConfig: [
                                {
                                    label: this.$t('config.shipper'),
                                    prop: "storerkey",
                                    input: "input",
                                },
                                {
                                    label: this.$t('config.company'),
                                    prop: "company",
                                    input: "input",
                                },
                                {
                                    label: this.$t('config.city'),
                                    prop: "city",
                                    input: "input",
                                },
                                {
                                    label: this.$t('config.provice'),
                                    prop: "state",
                                    input: "input",
                                },
                                {
                                    label: this.$t('config.postcode'),
                                    prop: "zip",
                                    input: "input",
                                },
                                {
                                    label: this.$t('config.contact'),
                                    prop: "contact",
                                    input: "input",
                                },
                                {
                                    label: this.$t('config.phone'),
                                    prop: "phone",
                                    input: "input",
                                },
                            ],
                            url: `/queryStorer/1/?/${this.$store.state.wms}`
                        },
                        {
                            type: "input",
                            label: this.$t('in.buyersreference'),
                            disabled: true,
                            props: "buyersreference"
                        },
                        {
                            type: "date",
                            label: this.$t('in.expectedreceiptdate'),
                            disabled: true,
                            props: "expectedreceiptdate"
                        },
                    ],
                    [
                        {
                            type: "input",
                            label: this.$t('in.sourcelocation1'),
                            disabled: true,
                            props: "sourcelocation"
                        },
                        {
                            type: "input",
                            label: this.$t('in.sellersreference'),
                            disabled: true,
                            props: "sellersreference"
                        },
                        {
                            type: "input",
                            label: this.$t('in.externalpokey2'),
                            disabled: true,
                            props: "externalpokey2"
                        },
                        {
                            type: "input",
                            label: this.$t('in.otherreference'),
                            disabled: true,
                            props: "otherreference"
                        },
                    ],
                    [
                        {
                            type: "input",
                            label: this.$t('in.overageoveridepercent'),
                            disabled: true,
                            props: "overageoveridepercent"
                        },
                    ]
                ],
                rules: {
                    pokey: [
                        {required: true, trigger: 'blur'},
                    ],
                    storerkey: [
                        {required: true, trigger: 'blur'},
                    ]
                },
            }
        },
        computed: {},
        methods: {
            setdata(data, id, close, listId) {
                this.inputData.storerkey = data.storerkey;
                close(false);
            }
        },
        mounted() {
        },
        watch: {},
        components: {
            'v-details': details
        }
    }
</script>

<style scoped>

</style>
